package com.jhhc.RHDB.Data.Pojo;



import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.text.DecimalFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;

public class ST_PPTN_R {
    private String stcd;

    private String tm;

    private Double drp;

    private Double intv;

    private Double pdr;

    private Double dyp;

    private String wth;

    //时间格式
    private String data;
    private String data1;
    private String month;
    private String month1;
    private String month2;
    private String S;
    private Date date;

    public Date getDate(){
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

        try {
            format.parse(getTm());
            return format.parse(getTm());
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return null;
    }
public void setDate(Date date){
        this.date = date;
}

    public String getData() {
       // System.out.println( setData());

        return  setData();
    }

    public void setData(String data) {

        this.data = data;
    }

    public String setData() {
        String data = getTm();
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); // 日期格式转换 天
        try {
           String day  =format.format(format.parse(data));
            return day;
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return null;
    }



    public String getData1() {

        return setData1();
    }

    public String setData1() {


        String data1 = getTm();
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // 日期格式转换 小时
        try {
         String day  = format.format(format.parse(data1)).substring(11,16);
            return day;
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return null;
    }

    public String getMonth() {

        return setMonth();
    }

    public String setMonth() {
        String month1 = getTm();
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // 日期格式转换 月份
        try {
            String day  = format.format(format.parse(month1)).substring(0,7);
          //  System.out.println(day);
            return day;
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return null;
    }

    public String getMonth2() {

        return setMonth2();
    }

    public String setMonth2() {
        String month1 = getTm();
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // 日期格式转换 月份
        try {
            String day  = format.format(format.parse(month1)).substring(8,10);
            return day;
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return null;
    }

    public String getMonth1() {

        return setMonth1();
    }

    public String setMonth1() {
        String month1 = getTm();
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // 日期格式转换 月份
        try {
            String day  = format.format(format.parse(month1)).substring(8,16);
            String day1  = format.format(format.parse(month1)).substring(11,16);
            if (day1.equals("08:00")){
                return day;
            }
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return "";
    }



    public String getStcd() {
        return stcd;
    }

    public void setStcd(String stcd) {
        this.stcd = stcd == null ? null : stcd.trim();
    }

    public String getTm() {
        return tm;
    }

    public void setTm(String tm) {
        this.tm = tm;
    }

    public Double getDrp() {
        return drp;
    }

    public void setDrp(Double drp) {
        this.drp = drp;
    }

    public Double getIntv() {
        return intv;
    }

    public void setIntv(Double intv) {
        this.intv = intv;
    }

    public Double getPdr() {
        return pdr;
    }

    public void setPdr(Double pdr) {
        this.pdr = pdr;
    }

    @Override
    public String toString() {
        return "ST_PPTN_R{" +
                "stcd='" + stcd + '\'' +
                ", tm='" + tm + '\'' +
                ", drp=" + drp +
                ", intv=" + intv +
                ", pdr=" + pdr +
                ", dyp=" + dyp +
                ", wth='" + wth + '\'' +
                '}';
    }

    public Double getDyp() {
        return dyp;
    }

    public void setDyp(Double dyp) {
        this.dyp = dyp;
    }

    public String getWth() {
        return wth;
    }

    public void setWth(String wth) {
        this.wth = wth == null ? null : wth.trim();
    }
}